//
//  CollectCustomCell.m
//  一点互助
//
//  Created by 张泊秋 on 16/9/3.
//  Copyright © 2016年 zhangboqiu. All rights reserved.
//

#import "CollectCustomCell.h"
#import <SDWebImage/UIImageView+WebCache.h>


@implementation CollectCustomCell

- (void)setModel:(WishesModel *)model {
    _model = model;
    NSString *str = [NSString stringWithFormat:@"%@%@",kGetPicURL,model.avatar];
    NSURL *url = [NSURL URLWithString:str];
    [self.headerImage sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"愿望-头像11"]];
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
    [formatter setTimeZone:timeZone];
    NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:[model.wishAddTime integerValue]];
    NSString *timeString = [formatter stringFromDate:confromTimesp];
    self.time.text = timeString;
    self.hot.text = [NSString stringWithFormat:@"%ld",(long)model.wishRewardNum];
    self.title.text = model.title;
    self.desc.text = model.wishDesc;
    self.wishRewardPrice.text = [NSString stringWithFormat:@"已打赏¥%.2lf",model.wishRewardPrice];
    self.wishRewardNum.text = [NSString stringWithFormat:@"已支持%ld",(long)model.wishRewardNum];
    self.price.text = [NSString stringWithFormat:@"求支持%.0lf",model.price];
    
    
    
    
}



@end
